package space.sakana.edusysback.mapper.cls;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import space.sakana.edusysback.entity.cls.Cls;
import space.sakana.edusysback.entity.cls.ClsTeacher;

import java.util.List;

@Mapper
public interface ClsTeacherMapper {

    @Select("select `id`, `tid`, `cid` from classteacher where `id`=#{id};")
    ClsTeacher selectClsTeacherById(int id);

    @Select("select `id`, `tid`, `cid` from classteacher where `cid`=#{cid};")
    List<ClsTeacher> selectClsTeachersByCid(int cid);

    @Select("select `id`, `tid`, `cid` from classteacher where `tid`=#{tid};")
    List<ClsTeacher> selectClsTeachersByTid(int tid);

    @Insert("insert into classteacher(`tid`, `cid`) values(#{tid}, #{cid});")
    int insertClsTeacher(ClsTeacher clsTeacher);

    @Update("update classteacher set `tid`=#{tid}, `cid`=#{cid} where `id`=#{id};")
    int updateClsTeacher(ClsTeacher clsTeacher);

}
